<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var arr = [1,5,4,3,5,2,6,3,4,5,6,1];
        var num;
        function sortNumber() {
            for (var j =0;j<arr.length-1;j++){
                for(var i = 0;i<arr.length-1-j;i++){
                    if(arr[i] > arr[i+1]){
                        num = arr[i];
                        arr[i] =arr[i+1];
                        arr[i+1] =num;
                    }
                }
            }
            return arr;
        }
        console.log(sortNumber(arr).join());
    </script>
</head>
<body>

</body>
</html>